import request from '@/utils/request'

// 分页获取推荐文章
export const getQueryHotArticles = () => {
	return request({
		url: 'queryHotArticles',
		method: 'get',
	})
}
// 获取一级分类列表
export const queryOneLevelCategory = () => {
	return request({
		url: 'queryOneLevelCategory',
		method: 'get',
	})
}
// 分页获取文章列表
export const queryList = (pageNo, pageSize) => {
	var params = new URLSearchParams();
	params.append('pageNo', pageNo);
	params.append('pageSize', pageSize);
	return request({
		url: 'queryList',
		method: 'post',
		data: params
	})
}
// 根据一级分类id分页获取一级分类下面的文章列表
export const queryArticlesBOLC = (data) => {
	var params = new URLSearchParams();
	for(var k in data){
		params.append(k,data[k]);
	}
	return request({
		url: 'queryArticlesBOLC',
		method: 'post',
		data: params
	})
}
//在一级分类下面根据关键字分页查询文章列表
export const likeArticlesByCate = (data) => {
	var params = new URLSearchParams();
	for(var k in data){
		params.append(k,data[k]);
	}
	return request({
		url: 'likeArticlesByCate',
		method: 'post',
		data: params
	})
}
export const queryArticle = (data) => {
	var params = new URLSearchParams();
	for(var k in data){
		params.append(k,data[k]);
	}
	return request({
		url: '/queryArticle',
		method: 'post',
		data: params
	})
}
export const queryTJArticle = (pageNo,pageSize) => {
	return request({
		url: '/queryTJpage/'+pageNo+"/"+pageSize,
		method: 'get',
	})
}